﻿using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;

namespace AgLux
{
    /// <summary>
    /// //
    /// </summary>
    
    public class Print : Control
    {
        private Canvas _mainArea;
        private TextBlock _text;

        /// <summary>
        /// //
        /// </summary>

        /// <param name="text">
        /// //
        /// </param>

        public Print(string text)
            : base()
        {
            FrameworkElement resource = InitializeFromXaml(new StreamReader(GetType().Assembly.GetManifestResourceStream("AgLux.Print.xaml")).ReadToEnd());

            _mainArea = (Canvas)resource.FindName("mainArea");
            _text = (TextBlock)resource.FindName("text");

            _mainArea.Width = BrowserHost.ActualWidth;
            _mainArea.Height = BrowserHost.ActualHeight;

            _text.Text = text;
            _text.Width = _mainArea.Width - 20;
            _text.Height = _mainArea.Height - 20;
        }
    }
}
